import Vue from "vue";

import "normalize.css/normalize.css"; // A modern alternative to CSS resets

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import locale from "element-ui/lib/locale/lang/en"; // lang i18n

import "@/styles/index.scss"; // global css
import "@/styles/index.css";

import App from "./App";
import store from "./store";
import router from "./router";

import "./utils/directives.js";
import "@/utils/format"; //时间格式化

ElementUI.Dialog.props.closeOnClickModal.default = false; // 全局设置Modal无法点击遮罩层关闭弹窗

import axios from "axios";
Vue.prototype.$http = axios;

import Print from "@/plugins/print.js";
Vue.use(Print);
import _ from "lodash";
Vue.prototype._ = _;

import { hiPrintPlugin, defaultElementTypeProvider } from "vue-plugin-hiprint";
Vue.use(hiPrintPlugin, "$pluginName");
Vue.use(defaultElementTypeProvider, "$defaultElementTypeProvider");
// hiPrintPlugin.disAutoConnect(); // 取消自动连接直接打印客户端
import "@/styles/hiprint.css"; // 自定义 css

Vue.directive("removeAriaHidden", {
  bind(el, binding) {
    let ariaEls = el.querySelectorAll(".el-radio__original");
    ariaEls.forEach(item => {
      item.removeAttribute("aria-hidden");
    });
  }
});

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI);

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});
